<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>vue1</title>
    <script src="../js/vue.js"></script>
</head>
<body>
<div id="app">
    {{message}}
</div>
<div id="app-2">
    <span v-bind:title="message">
        鼠标悬停查看绑定的提示信息
    </span>
</div>
<div id="app-3">
    <p v-if="seen">你能看到我</p>
</div>
<div id="app-4">
    <ol>
        <li v-for="todo in todos">
            {{todo.text}}
        </li>
    </ol>
</div>
<div id="app-5">
    <p>{{message}}</p>
    <button v-on:click="reverseMessage">逆转消息</button>
</div>
<div id="app-6">
    <p>{{message}}</p>
    <input v-model="message">
</div>
<div id="app-7">
    <ol>
        <todo-item v-for="item in groceryList" v-bind:todo="item"></todo-item>
    </ol>

</div>
<div id="app8">
    <app-nav></app-nav>
    <app-view>
        <app-sidebar></app-sidebar>
        <app-content></app-content>
    </app-view>
</div>
<script>
    var app = new Vue(
        {
            el: '#app',
            data: {
                message: 'hello vue!'
            }
        }
    )
    var app2 = new Vue(
        {
            el: '#app-2',
            data: {
                message: '页面加载于' + new Date() + ""
            }
        }
    )
    var app3 = new Vue({
        el: '#app-3',
        data: {
            seen: false
        }
    })
    var app4 = new Vue({
        el: '#app-4',
        data: {
            todos: [
                {text: "1"},
                {text: "2"},
                {text: "3"}
            ]
        }
    })

    var app5 = new Vue({
        el: '#app-5',
        data: {
            message: 'Hello Vue.js!'
        },
        methods: {
            reverseMessage: function () {
                this.message = this.message.split('').reverse().join('')
            }
        }
    })
    var app6 = new Vue({
        el: '#app-6',
        data: {
            message: 'Hello Vue!'
        }
    })
    Vue.component('todo-item', {
        props: ['todo'],
        template: '<li>{{todo.text}}</li>>'
    })
    var app7 = new Vue({
        el: '#app-7',
        data: {
            groceryList: [
                {text: '蔬菜'},
                {text: '奶酪'}
            ]
        }
    })
</script>
</body>
</html>